package com.example.constellation.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class URLcontent {

    //星座配对接口
    public static String getURL(String man,String woman){
       man= man.replace("座", "");
       woman=woman.replace("座","");
        try {
            man=URLEncoder.encode(man,"UTF-8");
            woman=URLEncoder.encode(woman,"UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }
        String url="http://apis.juhe.cn/xzpd/query?men="+man+"&women="+woman+"&key=f11be484fd9b1d579d9176dd65a27aa5";
        return url;
    }

    //星座运势接口
    public static String getysurl(String name)  {
        try {
            name=URLEncoder.encode(name,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        String url="http://web.juhe.cn:8080/constellation/getAll?consName="+name+"&type=year&key=ec2991c86758e256f0d1798268133857";
        return url;
    }
}
